package com.yuandian.utils.poi.converter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;

/**
 * 说明：业务完整性转换器
 * @Author yanjun
 * @Date 2020/12/25 16:56
 */
public class BusinessCompletionConverter implements Converter<Integer> {

    /**
     * java类型
     * @return
     */
    @Override
    public Class supportJavaTypeKey() {
        return Integer.class;
    }

    /**
     * excel类型
     * @return
     */
    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }

    /**
     * 读时调用
     * @param cellData
     * @param excelContentProperty
     * @param globalConfiguration
     * @return
     * @throws Exception
     */
//    @Override
//    public Integer convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty,
//                                     GlobalConfiguration globalConfiguration) throws Exception {
//        return null;
//    }
//
//    /**
//     * 写时调用
//     * @param val
//     * @param excelContentProperty
//     * @param globalConfiguration
//     * @return
//     * @throws Exception
//     */
//    @Override
//    public CellData convertToExcelData(Integer val, ExcelContentProperty excelContentProperty,
//                                       GlobalConfiguration globalConfiguration) throws Exception {
//        if (val == BusiFieldMapping.BUSINESS_COMPLETION) {
//            return new CellData("完整");
//        } else if (val == BusiFieldMapping.BUSINESS_NO_COMPLETION) {
//            return new CellData("不完整");
//        }
//        return new CellData("");
//    }
}
